package org.example.service.impl;

import org.example.mapper.InventoryMapper;
import org.example.domain.FruitInventory;
import org.example.service.InventoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InventoryServiceImol implements InventoryService {

    private static final Logger logger = LoggerFactory.getLogger(InventoryServiceImol.class);

    @Autowired
    InventoryMapper inventoryMapper;
    /**
     * 获取库存列表
     */
    @Override
    public List<FruitInventory> getInventoryList(String fruitName, String inventoryType, String inventoryStatus, Integer pageNum, Integer pageSize) {
        // 计算偏移量
        Integer offset = (pageNum - 1) * pageSize;
        // 调用Mapper查询数据
        List<FruitInventory> inventoryList=inventoryMapper.selectInventoryList(fruitName, inventoryType, inventoryStatus,offset, pageSize);
        return inventoryList;
    }



}
